<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__VIEW__/css/style1.css" rel="stylesheet" type="text/css" />
<link href="__VIEW__/css/select.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__STATIC__/css/hdjs.css" />
<script>
	var checkBrandName = "{|U:'updateChcekBrandName'}";
</script>
<script type="text/javascript" src="__STATIC__/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/hdjs.min.js"></script>
<script>
$(function(){
	var bid = $('input[name=bid]').val();
	var isok = false;
	$('#bname').blur(function(){
		$.ajax({
			url:checkBrandName,
			type:'post',
			dataType:'json',
			data:{bid:bid,bname:$(this).val()},
			success:function(phpData){
				if(phpData['status']==0){
					hd_alert({message:phpData['message'],timeout:3});
					isok = false;
					return false;
				}else{
					hd_alert({message:phpData['message'],timeout:3});
					isok = true;
					return true;
				}
			}
		})
	})
	$('#addBrandFrom').submit(function(){
		$('#bname').triggerHandler('blur');
		if(!isok){
			return false;
		}
	})
})
</script>
</head>

<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">品牌管理</a></li>
    <li><a href="#">添加品牌</a></li>
    
    </ul>
    </div>
    
    <div class="formbody">
    
   
    <div id="usual1" class="usual"> 
     
    <div class="itab">
  	<ul> 
    <li><a href="#tab1" class="selected">添加品牌</a></li> 
    <!--<li><a href="#tab2">自定义</a></li>--> 
  	</ul>
    </div> 
    
  	<div id="tab1" class="tabson">
    
    <div class="formtext">Hi，<b>{$hd.session.adminUser}</b>，欢迎管理员大人</div>
    <form action="{|U:'editBrand'}" method="post" id="addBrandFrom" enctype="multipart/form-data">
    <ul class="forminfo">
    <li><label for="bname">品牌名<b>*</b></label><input id="bname" value="{$brand.bname}" name="bname" type="text" class="dfinput" placeholder="请输入品牌名称"  style="width:518px;"/></li>
    <input type="hidden" value="{$brand.bid}" name="bid" />
   	<li><label>LOGO</label><if value="!empty($brand.blogo)"><img src="__ROOT__/{$brand.blogo}" id="blogo" /><else/><input type="file" name="blogo">请上传品牌LOGO</if><a href="javascript:;" id="toggleImg">[替换LOGO]</a></li>
   	<input type="hidden" value="{$brand.blogo}" name="cblogo" />	
    <li><label>品牌排序</label><input name="bsort" type="text" class="dfinput" value="{$brand.bsort}"  style="width:100px;"/></li>
    <li><label for="">缩放大小</label>
    	宽:<input type="text" name="width" value="100" class="dfinput" style="width:100px;" />
    	高:<input type="text" name="height" value="50" class="dfinput" style="width:100px;" />
    </li>
    <li><label>是否热门</label>
    	<label for="hot"><input name="ishot" type="radio" value="1" id="hot" <if value="$brand.ishot==1">checked="checked"</if>/>热门</label>
    	<label for="nohot"><input name="ishot" type="radio" value="0"  id="nohot"  <if value="$brand.ishot==0">checked="checked"</if>  />正常</label>
    </li>
   
    <li><label>&nbsp;</label><input type="submit" class="btn" value="更新品牌"/></li>
    </ul>
    </form>
    </div> 
	</div> 
    <script>
    	$('#toggleImg').toggle(function(){
    		
    		$(this).html('[查看当前LOGO]');
    		$('#blogo').hide();
    		var str = '<input type="file" name="blogo">';
    		$(this).before(str);
    	},function(){
    		$(this).html('[替换LOGO]');
    		$('#blogo').show();
    		$(this).prev().remove();
    	})
    </script>
    
    </div>


</body>

</html>
